﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;

namespace AirSystem
{
    public class MeKongAirWebClient:WebClient
    {
        private string MyAddress;

        public static MeKongAirWebClient GetMeKongAirWebClient(string address)
        {
            MeKongAirWebClient webClient = new MeKongAirWebClient();
            webClient.MyAddress = address;
            webClient.Headers["Cookie"] = "__utma=187758136.564104008.1355561576.1356251694.1356273775.25; __utmb=187758136.1.10.1356273775; __utmc=187758136; __utmz=187758136.1356273775.25.21.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); ASP.NET_SessionId=vyhhvv551f1h1r55h3p1ri55";
            return webClient;
        }

        public string LoadPage(string postData)
        {
            
            HttpWebRequest request = (HttpWebRequest)GetWebRequest(new Uri(MyAddress));
            request.ServicePoint.Expect100Continue = false;
            Headers["Content-Type"] = "application/x-www-form-urlencoded";
            byte[] byteRespone = UploadData(MyAddress, "POST", System.Text.Encoding.UTF8.GetBytes(postData));

            string text= System.Text.Encoding.UTF8.GetString(byteRespone);
            return text;
        }
    }

    

    
}
